#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include<QFile>
#include<QTimer>
#include <QAudioFormat>
#include <QAudioOutput>
#include<QAudioInput>
#include<MyBuffer.h>
#include<QThread>
#include<MyThread.h>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget {
Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);

    ~Widget();

private slots:

    void on_pushButton_clicked();

private:
    Ui::Widget *ui;
    QIODevice* dev;
    QTcpSocket* socket;
    QTimer *t;
    MyBuffer *buffer;
    QFile *f = nullptr;
    QAudioFormat *format = nullptr;
    QAudioOutput *outPut = nullptr;
    QAudioInput *input = nullptr;
    MyThread *task;

    void add(QAudio::State state);
};

#endif // WIDGET_H
